/**
 * User: alesj
 * Date: 2005.6.8
 * Time: 11:20:35
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.generalynx.ecos.page;

import java.io.Serializable;

import org.hibernate.transform.ResultTransformer;

public class EmptyPageScroll implements PageScroll {

    protected Class clazz;

    protected String select() {
        Class wrapper = wrapper();
        return wrapper != null ? ("select new " + wrapper.getSimpleName() + "(e) " ) : "";
    }

    protected Class wrapper() {
        return null;
    }

    public Serializable getCurrentIdentifier() {
        return null;
    }

    public void setClass(Class clazz) {
        this.clazz = clazz;
    }

    public void setCurrentIdentifier(String stringIdentifier) {
    }

    public Serializable getPreviousIdentifier() {
        return null;
    }

    public Serializable getNextIdentifier() {
        return null;
    }

    public int firstResult() {
        return 0;
    }

    public int getLimit() {
        return Integer.MAX_VALUE;
    }

    public boolean hasTotalCount() {
        return false;
    }

    public int getTotalCount() {
        return 0;
    }

    public void setTotalCount(int totalCount) {
    }

    public boolean isUsePageScroll() {
        return false;
    }

    public boolean hasPrevious() {
        return !isFirst();
    }

    public boolean hasNext() {
        return !isLast();
    }

    public boolean isFirst() {
        return true;
    }

    public boolean isLast() {
        return true;
    }

    public String getTaskbar() {
        return null;
    }

    public boolean isLimitable() {
        return true;
    }

    public String query() {
        return select() + "from " + from() + " e order by " + orderBy();
    }

    protected String from() {
        return clazz.getName();
    }

    public Object propertiesBean() {
        return null;
    }

    public String orderBy() {
        return "e.id";
    }

    public ResultTransformer transformer() {
        return null;
    }
}
